package com.ruoyi.yljf.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.utils.bean.BeanUtils;
import com.ruoyi.yljf.domain.dto.ActiveDTO;
import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BasePlusEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 活动对象 yljf_active
 * 
 * @author metaee
 * @date 2025-02-13
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName(value = "yljf_active")
public class Active extends BasePlusEntity {
    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /** 主键id */
    @TableId(type = IdType.AUTO)
    private Long activeId;

    /** 活动标题 */
    @Excel(name = "活动标题")
    private String activeName;

    /** 活动标题 */
    @Excel(name = "活动图片")
    private String activeImg;

    /** 开始时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date startTime;

    /** 结束时间 */
    @JsonFormat(pattern = "yyyy-MM-dd")
    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date endTime;

    /** 活动地址 */
    @Excel(name = "活动地址")
    private String activeAddress;

    /** 用户手机号 */
    @Excel(name = "创建者手机号")
    private String userPhone;

    /** 活动介绍 */
    @Excel(name = "活动介绍")
    private String activeInfo;

    /** 活动收费价格 */
    @Excel(name = "活动收费价格")
    private BigDecimal activePrice;

    /** 书籍是否免费(Y | N) */
    @Excel(name = "书籍是否免费(Y | N)")
    private String activeFree;

    /** 活动分类（online |  offline） */
    @Excel(name = "活动分类", readConverterExp = "online,|=,offline")
    private String activeType;

    /** 創建用戶ID */
    @Excel(name = "創建用戶ID")
    private Long userId;


    public Active(ActiveDTO activeDTO){
        BeanUtils.copyProperties(activeDTO, this);
    }

}
